package com.itheima.controller;

import com.itheima.common.R;
import com.itheima.manager.PmsSkuStockManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping
public class PmsSkuStockController {
    @Autowired
    PmsSkuStockManager pmsSkuStockManager;

    @GetMapping ("/sku/{pid}")
    public R findSkuStockByInfo(
            @PathVariable(value = "pid") Integer pid,
            @RequestParam(required = false) String keyword
    ) {
      return R.success(  pmsSkuStockManager.findSkuStockByInfo(pid, keyword));
    }


}
